package com.example.springboot.mapper;

import com.example.springboot.entity.feedbacks;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface FeedbackMapper {

    @Select("select * from feedbacks")
    List<feedbacks> selectAll();

    @Delete("DELETE FROM feedbacks WHERE feedback_id=#{feedback_id} ")
    void deleteFeedback(int feedback_id);

    @Update("UPDATE feedbacks SET content=#{content}, status=#{status}, response=#{response}, responded_at=#{responded_at} WHERE feedback_id=#{feedback_id}")
    void editFeedback(feedbacks feedbacks);
}
